let cfg = {}
cfg.sys = 'cleanbio';
// cfg.sys = 'cleancase';
cfg.ver = '1.10';
cfg.data = {};
if (process.env.NODE_ENV !== 'development') {
    // 开发环境
    cfg.url = 'http://localhost:48080/app-api'
    cfg.adminurl = 'http://localhost:48080/admin-api'
    cfg.SHOPRO_WEBSOCKET_PATH = '/infra/ws'
    cfg.filepath = 'http://sg.deeyi.com/api/eerp/uploads/file/';
} else {
    // 生产环境
    cfg.url = 'https://www.liujianggongyi.site/app-api'
    cfg.adminurl = 'https://www.liujianggongyi.site/admin-api'
    cfg.SHOPRO_WEBSOCKET_PATH = '/infra/ws'
    cfg.filepath = 'https://sg.deeyi.com/api/eerp/uploads/file/';
}

cfg.token = function (a) {
    if (typeof (a) == "undefined") {
        let a = '';
        try { a = uni.getStorageSync(cfg.sys + '_token') || '' } catch (e) { }
        return a;
    } else {
        try { uni.setStorageSync(cfg.sys + '_token',a); } catch (e) { }
    }
}


cfg.user = function (a) {
    if (typeof (a) == "undefined") {
        let a = '';
        try { a = uni.getStorageSync(cfg.sys + '_user') || {} } catch (e) { }
        return a;
    } else {
        try { uni.setStorageSync(cfg.sys + '_user',a); } catch (e) { }
    }
}
cfg.sysInfo = function (a) {
    if (typeof (a) == "undefined") {
        let a = '';
        try { a = uni.getStorageSync(cfg.sys + '_sysInfo') || {} } catch (e) { }
        return a;
    } else {
        try { uni.setStorageSync(cfg.sys + '_sysInfo',a); } catch (e) { }
    }
}


export default cfg


// 全局引入
// import  cfg from '@/common/config.js'
// cfg.url
// Vue.prototype.$cfg = cfg;
// 使用
// this.$cfg.sign() //读
// this.$cfg.sign('123') //写
